<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'alarmList.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<style type="text/css">
.controls.inline>* {
	display: inline-block;
}

.controls.inline>input {
	width: 100px;
}
</style>
</head>
<body>
	<div class="control-group">
		<div class="controls inline">
			<input class="input-xlarge focused" id="focusedInput" type="text"
				placeholder="请输入关键字"> <label for="focusedInput">单位名称:</label>
			<input class="input-xlarge focused" type="text" value=""> <label
				for="focusedInput">时间:</label> <input class="input-xlarge focused"
				type="text" value=""> - <input class="input-xlarge focused"
				type="text" value="">
			<button class="btn btn-primary btn-mini">查询</button>
		</div>
		<div class="controls">
			<a href="index.do?jspName=addAlarm"class="btn btn-primary btn-mini">添加</a> 
			<a href=""class="btn btn-primary btn-mini">编辑</a> 
			<a href=""class="btn btn-primary btn-mini">删除</a> 
		</div>
	</div>
	<div class="row-fluid" ng-app="alarmApp" ng-controller="alarmListCtrl">
		<div class="span12">
			<div class="block">
				<div class="navbar navbar-inner block-header">
					<div class="muted pull-left">警情总览</div>
				</div>
				<div class="block-content collapse in">
					<div class="span12">
						<div id="example_wrapper" class="dataTables_wrapper form-inline"
							role="grid">
							<div class="row">
								<div class="span6">
									<div id="example_length" class="dataTables_length">
										<label><select size="1" name="example_length"
											style="width: 76px;margin-left: 20px;"
											aria-controls="example"><option value="10"
													selected="selected">10</option>
												<option value="25">25</option>
												<option value="50">50</option>
												<option value="100">100</option></select> records per page</label>
									</div>
								</div>
								<div class="span6" style="text-align: right;">
									<div class="dataTables_filter" id="example_filter">
										<label>Search: <input type="text"
											aria-controls="example"></label>
									</div>
								</div>
							</div>
							<table cellpadding="0" cellspacing="0" border="0"
								class="table table-striped table-bordered" id="example">
								<thead>
									<tr>
										<th>#</th>
										<th>单位名称</th>
										<th>报警时间</th>
										<th>接警时间</th>
										<th>类型</th>
										<th>警情描述</th>
										<th>处理结果</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="alarm in response.dataList">
										<td>{{$index+1}}</td>
										<td>{{alarm.company_name}}</td>
										<td>{{alarm.company_name}}2015-03-14 13：49</td>
										<td>{{alarm.p_desc}}2015-03-14 13：49</td>
										<td>{{alarm.p_desc}}火警</td>
										<td>{{alarm.p_desc}}火警</td>
										<td>{{alarm.p_desc}}未处理</td>
									</tr>

								</tbody>
							</table>
						</div>
						<div class="row" style="margin-left: 4px;">
							<div class="span6">
								<div class="dataTables_info" id="example_info">{{response.data.start+1}}
									to {{response.data.count}} of {{response.data.count}} entries</div>
							</div>
							<div class="span6">
								<div class="dataTables_paginate paging_bootstrap pagination" style="margin-top:0;">
									<ul>
										<li class="prev disabled"><a href="#">← Previous</a></li>
										<li class="active"><a href="#">1</a></li>
										<li><a href="#">2</a></li>
										<li><a href="#">3</a></li>
										<li><a href="#">4</a></li>
										<li><a href="#">5</a></li>
										<li class="next"><a href="#">Next → </a></li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /block -->
		</div>
	</div>
	<script>
		var app = angular.module('alarmApp', []);
		app.controller('alarmListCtrl', function($scope, $http) {
			$http.get("loadAlarmListBySearch.json?type=2").success(function(response) {
				$scope.response = response;
				$scope.page = response;
			});
		});
	</script>
</body>
</html>
